home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 51
/
051.d81
/
text printer
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
94 lines
0 ifa=.thena=1:load"tp.disk.o",8,1
1 ifa=1thena=2:load"tp.print1.o",8,1
2 ifa=2thena=3:load"tp.print2.o",8,1
3 goto110
5 :
6 rem alter rom scrolling
7 :
10 poke770,131:poke771,164:poke88,.:poke89,192:poke90,.:poke91,192
20 poke781,33:poke782,.:sys41964:poke88,254:poke89,255:poke90,254:poke91,255
30 poke781,33:poke782,.:sys41964:poke59639,5:poke1,53
40 return
100 :
105 rem setup stuff...
106 :
110 poke55,.:poke56,32:clr:q$=chr$(34)
120 dim fi$(144),ft%(144),nb%(144)
122 ft$(0)="":ft$(1)=",s":ft$(2)=",p":fl=0
125 gosub1000:gosub10
130 print"[147] [154][201]nsert disk and press [211][208][193][195][197]":poke198,.
140 ifpeek(203)<>60then140
160 print"[147] [154][210]eading all "q$"[208][210][199]"q$" [154]files w / "q$"[212]."q$" [154]names"
170 print" [154][208]ress [193] [154]to abort while printing text."
180 :
185 rem read the directory
190 :
200 open15,8,15,"i0":open8,8,8,"#"
210 print#15,"u1:"8;0;18;1
220 sys49152,fi$,ft%,nb%
230 if (left$(fi$,2)<>"t.") or (ft%<>130) then ok=.:goto240
235 co=co+1:fi$(co)=fi$:ft%(co)=ft%:nb%(co)=nb%:ok=1
240 if(ok)thenprint"";fi$
250 a=peek(2):ifa=.then220
260 ifa<>255thenprint#15,"u1:"8;0;18;a:print#15,"b-p:"8;0:goto220
270 close8:close15
280 :
285 :
290 rem print those files!!
295 :
300 print:for a=1 to co
305 print"[154][210]eading: "fi$(a)
306 iffi$(a)<>""then310
307 print"[154] [212]here are no "q$"t."q$"[154] files on this disk."
308 goto2000
310 sys 49155,8192,fi$(a)
315 ea=(peek(781)+peek(782)*256): poke ea,.:pokeea+1,13:poke ea+2,13
320 open4,4,7:z=.:a$=""
321 ifpeek(8192+z)=13then323
322 a$=a$+chr$(peek(8192+z)):z=z+1:goto321
323 s=8192:ifleft$(a$,3)="^u:"thens=8192+len(a$)+1
325 print"[154][145][208]rinting: "fi$(a):poke2,.
330 if(fl)then sys 52224,s:sp=59-peek(787)
340 iffl=0then sys 51200,s:sp=peek(787)+5
345 ifpeek(2)=0then360
346 sys65484:print"[145][150] [193]re you sure you want to quit? ([217][150]/[206][150])":poke198,.
347 geta$:ifa$<>"y"anda$<>"n"then347
348 ifa$="y"thena=co-1:run1
349 print"[145] "
350 print"[145][154][208]rinting: "fi$(a):poke2,.
351 if(fl)thenpoke781,4:sys65481: sys52486:sp=59-peek(787)
352 iffl=0thenpoke781,4:sys65481: sys51318:sp=peek(787)+5
354 ifpeek(2)=1then346
360 for b=1 to sp:print#4:next:close4
365 print"[145][154][198]inished printing: "fi$(a)
370 next:run1
1000 poke53281,0:poke53280,0
1010 print"[147][159]"
1020 print" [204][207][193][196][211][212][193][210]'[211] [212][197][216][212] [208][210][201][206][212][197][210]
1030 [153]"cont by (NULL)ike (NULL)aynard
1040 print"[158] [212]his program will print out all of"
1050 print" the files on the disk that start with"
1060 print" the prefix "q$"t."q$". [212]hese are the"
1070 print" files that are shown on the screen"
1080 print" when you choose '[210]un [201]t' from the"
1090 print" small yellow menu."
1092 print" [205]ake sure your printer is on-line"
1094 print" and the print head is set to the top"
1096 print" of a page."
1100 print" [159]([212][159])wo columns"
1110 print" [159]([211][159])ingle column in mid-page"
1120 print" [159]([210][159])eturn to [204][207][193][196][211][212][193][210]"
1130 print" [154][208]ress [212][154], [211] or [210]"
1140 geta$:ifa$<>"t"anda$<>"s"anda$<>"r"then1140
1145 ifa$="r"thenprint"[147]":goto2000
1150 fl=0:ifa$="t"thenfl=1
1160 return
2000 print" [196]o you want to return"
2005 print" to [204][207][193][196][211][212][193][210]? (y[154]/n[154])"
2010 poke198,.
2020 geta$:ifa$<>"y"anda$<>"n"then2020
2030 ifa$="n"thenrun1
2040 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
2050 ifer<>63thenend
2060 poke1,119:load"hello connect",8